using NL.UI;
using NL;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

namespace XGame.UI
{
    public class WinAngle : Window
    {
        public List<UISkillItem> skill_items;

        public Text hp_txt;

        private string hp_str;

        private IniArrAction _ONSkillsQuery;
        public WinAngle WaitSkillsQuery(IniArrAction _on)
        {
            _ONSkillsQuery = _on;
            return this;
        }

        public WinAngle SetHPText(string txt)
        {
            hp_str = txt;
            return this;
        }

        protected override void OnShow()
        {
            base.OnShow();

            hp_txt.text = hp_str;

			var arr = _ONSkillsQuery?.Invoke();

            List<NLIni> _infos = new List<NLIni>();
            _infos.AddRange(arr);

			for(int i = 0; i < _infos.Count; i++)
            {
                skill_items[i].gameObject.INFOSet(_infos[i]);
                skill_items[i].Show();
            }

        }

    }
}

